﻿<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App10"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ViewModels="using:App10.ViewModels"
    x:Class="App10.MainPage"
    mc:Ignorable="d">

    <Page.DataContext>
        <ViewModels:MainPageViewModel/>
    </Page.DataContext>

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="400" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Hub Header="Facebook" Background="White">
            <HubSection Width="400" Background="Gray">
                <DataTemplate/>
            </HubSection>
        </Hub>
        <Rectangle Fill="Gray" Grid.Column="2" />
        <ScrollViewer Grid.Column="1">
            <ItemsControl ItemsSource="{Binding Posts}" Margin="0,0,50,0">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Border BorderBrush="DimGray" BorderThickness="0,.5,0,0">
                            <Grid Margin="0,10,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="70" />
                                    <ColumnDefinition Width="500" />
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Background="Silver" Width="50" Height="50" VerticalAlignment="Top" />
                                <StackPanel Grid.Column="1">
                                    <TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextBlockStyle}" />
                                    <TextBlock Text="{Binding Text}" Style="{StaticResource SubtitleTextBlockStyle}" />
                                    <Rectangle Height="200" Fill="Wheat" Margin="0,10" />
                                    <ItemsControl ItemsSource="{Binding Comments}">
                                        <ItemsControl.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <StackPanel />
                                            </ItemsPanelTemplate>
                                        </ItemsControl.ItemsPanel>
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate>
                                                <Border Background="#FFEDEFF4" Margin="0,0,0,10" RequestedTheme="Light">
                                                    <StackPanel Orientation="Horizontal" Margin="10">
                                                        <Border Height="25" Width="25" Background="Silver" Margin="0,0,10,0" />
                                                        <TextBlock VerticalAlignment="Top">
                                                                        <Run Text="{Binding Author}" FontWeight="Bold" />
                                                                        <Run Text="{Binding Text}" />
                                                                        <LineBreak />
                                                                        <Run Text="4 hours ago" Foreground="Gray" />
                                                        </TextBlock>
                                                    </StackPanel>
                                                </Border>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                    </ItemsControl>
                                </StackPanel>
                            </Grid>
                        </Border>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>

    </Grid>
</Page>
